<style>
  .head-header{
        display: block;
    }
  .navbar-default {
    position: fixed;
    top: 0;
    z-index: 999;
    background-color: #fff;
    background-image: url("/static/img/mainbg.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    min-width: 100%;
  }
  .nav>li>a>img {
    max-width: 130px;
    max-height: 60px;
    }
</style>



<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active">
          <a href="/">
            <img src="/static/img/晋江文学.jpg" alt="晋哆咕-晋">
            <span class="sr-only">(current)</span>
          </a></li>
        <li>
          <a href="/">
            <img src="/static/img/哆哆追剧.png" alt="晋哆咕-哆">
          </a>
        </li>
        <li>
          <a href="/">
            <img src="/static/img/咪咕音乐.png" alt="晋哆咕-咕">
          </a>
        </li>
      </ul>
      <form class="navbar-form navbar-left" method="get" action="/search/" target="_blank">
        <div class="form-group">
          <input type="text" name="q" class="form-control" placeholder="输入关键词">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        {% if request.user.is_authenticated %}
          <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ request.user.username }}
              <span class="caret"></span>
              <img class="head-header" src="/media/{{ request.user.head }}" alt="">
            </a>
            <ul class="dropdown-menu">
              <li><a href="/user/center">个人中心</a></li>
              <li><a href="/user/updatepwd">修改密码</a></li>
              <li><a href="/operate/collect">藏书</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="{% url 'user:logout' %}">退出</a></li>
            </ul>
          </li>
        {% else %}
          <li><a href="/user/login">登录</a></li>
          <li><a href="/user/register">注册</a></li>
        {% endif %}
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>